package com.wanbatv.wangwangba.chengzhang;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.wanbatv.wangwangba.R;

/**
 * Created by 俞亚楠 on 2015/8/28.
 */
public class ChengzhangLayout extends LinearLayout {
    private Context context;
    private AttributeSet attrs;
    private LinearLayout chengzhang_layout_1;
    public ChengzhangLayout(Context context){
        super(context);
        this.context=context;
        LayoutInflater.from(context).inflate(R.layout.chengzhang_layout, this, true);
        for (int i=0;i<7;i++) {
            chengzhang_layout_1 = (LinearLayout) findViewById(R.id.chengzhang_layout_1);
            ChengzhangDemo czd = new ChengzhangDemo(context);
            RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);

            chengzhang_layout_1.addView(czd, lp1);
        }

    }
    public ChengzhangLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context=context;
        this.attrs=attrs;
        LayoutInflater.from(context).inflate(R.layout.chengzhang_layout, this, true);
        chengzhang_layout_1=(LinearLayout)findViewById(R.id.chengzhang_layout_1);
        ChengzhangDemo czd=new ChengzhangDemo(context);
        RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);

            chengzhang_layout_1.addView(czd, lp1);

    }
}
